/*
 * File Name : node._factory.cpp
 * Auther : dream.liuguobiao
 * Create Date : 2010-5-14
 * Last Edit : 2010-5-16
 */

#include "node_factory.h"
#include "node.h"

#include "directory.h"
#include "file.h"

node_factory *node_factory::instance_node_factory = NULL ;

node_factory::node_factory()
{
}


node_factory *node_factory::get_node_factory(){
  if( NULL == instance_node_factory)
    instance_node_factory = new node_factory();
  return instance_node_factory;
}


node *node_factory::get_node(std::string *type){
  node *new_node;
  if( "directory" == *type )new_node = new directory();
  else if ( "file" == *type )new_node = new file();
  else new_node = NULL;

  return new_node;
}
